<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BookingTest
 *
 * @author fabiano
 */
class BookingTest {
    //put your code here
    
    private $booking_id;
    private $order_id;
    private $booking_date;
    private $currency;
    private $amount;
    private $user_ip;
    private $supplier_code;
    private $supplier_message;
    private $supplier_booking_ref;
    private $result_credit_card;
    private $result_credit_card_message;
    private $pasref;
    private $authcode;
    private $batchid;
    private $sttle_void_result;
    private $sttle_void_result_message;
    private $status;
    
    
    /**
     * Constructor with all atributes necessary to create this class
     * @param type $params 
     */
    function __construct($params) {
        $this->setAmount($params['amount']);
        $this->setAuthcode($params['authcode']);
        $this->setBatchid($params['batchid']);
        $this->setBooking_date($params['booking_date']);
        //$this->setBooking_id($params['booking_id']);
        $this->setCurrency($params['currency']);
        $this->setOrder_id($params['order_id']);
        $this->setPasref($params['pasref']);
        $this->setPasref($params['pasref']);
        $this->setResult_credit_card($params['result_credit_card']);
        $this->setResult_credit_card_message($params['result_credit_card_message']);
        $this->setStatus($params['status']);
        $this->setSttle_void_result($params['sttle_void_result']);
        $this->setSttle_void_result_message($params['sttle_void_result_message']);
        $this->setSupplier_booking_ref($params['supplier_booking_ref']);
        $this->setSupplier_code($params['supplier_code']);
        $this->setSupplier_message($params['supplier_message']);
        $this->setUser_ip($params['user_ip']);
    }

    
    public function getBooking_id() {
        return $this->booking_id;
    }

    public function setBooking_id($booking_id) {
        $this->booking_id = $booking_id;
    }

    public function getOrder_id() {
        return $this->order_id;
    }

    public function setOrder_id($order_id) {
        $this->order_id = $order_id;
    }

    public function getBooking_date() {
        return $this->booking_date;
    }

    public function setBooking_date($booking_date) {
        $this->booking_date = $booking_date;
    }

    public function getCurrency() {
        return $this->currency;
    }

    public function setCurrency($currency) {
        $this->currency = $currency;
    }

    public function getAmount() {
        return $this->amount;
    }

    public function setAmount($amount) {
        $this->amount = $amount;
    }

    public function getUser_ip() {
        return $this->user_ip;
    }

    public function setUser_ip($user_ip) {
        $this->user_ip = $user_ip;
    }

    public function getSupplier_code() {
        return $this->supplier_code;
    }

    public function setSupplier_code($supplier_code) {
        $this->supplier_code = $supplier_code;
    }

    public function getSupplier_message() {
        return $this->supplier_message;
    }

    public function setSupplier_message($supplier_message) {
        $this->supplier_message = $supplier_message;
    }

    public function getSupplier_booking_ref() {
        return $this->supplier_booking_ref;
    }

    public function setSupplier_booking_ref($supplier_booking_ref) {
        $this->supplier_booking_ref = $supplier_booking_ref;
    }

    public function getResult_credit_card() {
        return $this->result_credit_card;
    }

    public function setResult_credit_card($result_credit_card) {
        $this->result_credit_card = $result_credit_card;
    }

    public function getResult_credit_card_message() {
        return $this->result_credit_card_message;
    }

    public function setResult_credit_card_message($result_credit_card_message) {
        $this->result_credit_card_message = $result_credit_card_message;
    }

    public function getPasref() {
        return $this->pasref;
    }

    public function setPasref($pasref) {
        $this->pasref = $pasref;
    }

    public function getAuthcode() {
        return $this->authcode;
    }

    public function setAuthcode($authcode) {
        $this->authcode = $authcode;
    }

    public function getBatchid() {
        return $this->batchid;
    }

    public function setBatchid($batchid) {
        $this->batchid = $batchid;
    }

    public function getSttle_void_result() {
        return $this->sttle_void_result;
    }

    public function setSttle_void_result($sttle_void_result) {
        $this->sttle_void_result = $sttle_void_result;
    }

    public function getSttle_void_result_message() {
        return $this->sttle_void_result_message;
    }

    public function setSttle_void_result_message($sttle_void_result_message) {
        $this->sttle_void_result_message = $sttle_void_result_message;
    }

    public function getStatus() {
        return $this->status;
    }

    public function setStatus($status) {
        $this->status = $status;
    }    
        
    public function save (){
        $params = new ArrayObject($this);
        $sql = "INSERT INTO booking_test SET ".make_set_clause($params);  
        error_log("[BookingTest.class] - save " .$sql);
        $result = mysql_query($sql) or die (mysql_error());
        $this->booking_id = mysql_insert_id();    
    }
    
    public function update(){
        
    }
    
    public function delete(){        

    }
            
}

?>
